<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');

/**
 * TYPOlight webCMS
 *
 * The TYPOlight webCMS is an accessible web content management system that 
 * specializes in accessibility and generates W3C-compliant HTML code. It 
 * provides a wide range of functionality to develop professional websites 
 * including a built-in search engine, form generator, file and user manager, 
 * CSS engine, multi-language support and many more. For more information and 
 * additional TYPOlight applications like the TYPOlight MVC Framework please 
 * visit the project website http://www.typolight.org.
 * 
 * The Catalog extension allows the creation of multiple catalogs of custom items,
 * each with its own unique set of selectable field types, with field extendability.
 * The Front-End modules allow you to build powerful listing and filtering of the 
 * data in each catalog.
 * 
 * PHP version 5
 * @copyright	Martin Komara 2009
 * @author		Martin Komara, 
 * @package		CustomMenu
 * @license		LGPL 
 * @filesource
 */


/**
 * Add palettes to tl_module
 */


$GLOBALS['TL_DCA']['tl_module']['palettes']['custommenu']    = '{title_legend},name,headline,type;{nav_legend},levelOffset,showLevel,hardLimit;{config_legend},custommenu_defineRoots;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';

$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'][] = 'custommenu_defineRoots';

$GLOBALS['TL_DCA']['tl_module']['subpalettes']['custommenu_defineRoots'] = 'custommenu_roots,custommenu_useChildren';


array_insert($GLOBALS['TL_DCA']['tl_module']['config']['onload_callback'], 1, 
	array(array('tl_module_catalog', 'onLoadCallback'))
);

/**
 * Add fields to tl_module
 */

$GLOBALS['TL_DCA']['tl_module']['fields']['custommenu_defineRoots'] = array
(
    'label'                   => &$GLOBALS['TL_LANG']['tl_module']['custommenu_defineRoots'],
    'exclude'                 => true,
    'inputType'               => 'checkbox',
    'eval'                    => array('submitOnChange'=> true)
);

$GLOBALS['TL_DCA']['tl_module']['fields']['custommenu_roots'] = array
(
    'label'                   => &$GLOBALS['TL_LANG']['tl_module']['custommenu_roots'],
    'inputType'               => 'tableTree',
    'eval'                    => array('fieldType' => 'checkbox', 'tableColumn'=> 'tl_custommenu.title', 'children' => true),
);
        
$GLOBALS['TL_DCA']['tl_module']['fields']['custommenu_useChildren'] = array
(
    'label'                   => &$GLOBALS['TL_LANG']['tl_module']['custommenu_useChildren'],
    'inputType'               => 'checkbox',
);

?>
